import axios, { requestWithoutErrorToast } from 'utils/request'

interface ISCourse {
  moduleId: String
  pNo?: Number
  pSize?: Number
}

interface ISChapter {
  courseId: Number
}

interface IAddress {
  courseId: Number
}

const getCourse = (data: ISCourse) => {
  return axios({
    method: 'post',
    url: '/v3/channel/module/course',
    data: data,
  })
}

const getChapter = (data: ISChapter) => {
  return axios({
    method: 'post',
    url: '/v3/channel/module/course/chapter',
    data,
  })
}

const getAddress = (data: IAddress) => {
  return axios({
    method: 'post',
    url: '/v3/channel/module/course/address',
    data,
  })
}

export default {
  getCourse,
  getChapter,
  getAddress,
}
